package com.lc1993929.redis.first;

import redis.clients.jedis.Jedis;

/**
 * Created by LiuChang on 2017/3/30.
 */
public class RedisStringJava {
    public static void main(String[] args) {
        //连接本地的redis服务
        Jedis jedis = new Jedis("localhost");
        jedis.auth("4651248");
        System.out.println("Connection to server sucessfully");
        //设置redis字符串数据
        jedis.set("runoobkey", "Redis tutorial");
        //获取存储的数据并输出
        System.out.println("Stored string in redis：： " + jedis.get("runoobkey"));
    }
}
